<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../css/mui.min.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
			
			.mui-bar~.mui-content .mui-fullscreen {
				top: 44px;
				height: auto;
			}
			
			.mui-slider-indicator.mui-segmented-control {
				/*background-color: #efeff4;*/
				background-color: whitesmoke;
			}
		</style>
	</head>

	<body>
		<div class="mui-content">
			<div id="slider" class="mui-slider mui-fullscreen">
				<div  id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll">
						<a class="mui-control-item mui-active" href="#item1mobile" data-wid="contentpages/content1.html">
							推荐
						</a>
						<a class="mui-control-item" href="#item2mobile" data-wid="contentpages/content2.html">
							热点
						</a>
						<a class="mui-control-item" href="#item3mobile" data-wid="contentpages/content3.html">
							北京
						</a>
						<a class="mui-control-item" href="#item4mobile" data-wid="contentpages/content4.html">
							社会
						</a>
						<a class="mui-control-item" href="#item5mobile" data-wid="contentpages/content5.html">
							娱乐
						</a>
					</div>
				</div>
			</div>
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/webviewGroup.js" type="text/javascript" charset="utf-8"></script>
		<script>
			
			mui.init();
			
			mui.plusReady(function() {
				var currentId=plus.webview.currentWebview().id;
				var group = new webviewGroup(currentId, {
					items: [{
						id: "contentpages/content1.html",
						url: "contentpages/content1.html",
						extras: {}
					}, {
						id: "contentpages/content2.html",
						url: "contentpages/content2.html",
						extras: {}
					}, {
						id: "contentpages/content3.html",
						url: "contentpages/content3.html",
						extras: {}
					}, {
						id: "contentpages/content4.html",
						url: "contentpages/content4.html",
						extras: {}
					}, {
						id: "contentpages/content5.html",
						url: "contentpages/content5.html",
						extras: {}
					}],
					onChange: function(obj) {
						var c = document.querySelector(".mui-control-item.mui-active");
						if(c) {
							c.classList.remove("mui-active");
						}
						document.querySelector(".mui-scroll .mui-control-item:nth-child(" + (parseInt(obj.index) + 1) + ")").classList.add("mui-active");
					}
				});
				
				mui(".mui-scroll").on("tap", ".mui-control-item", function(e) {
					var wid = this.getAttribute("data-wid");
					group.switchTab(wid);
				});

			});
			mui.back = function() {
				var _self = plus.webview.currentWebview();
				_self.close("auto");
			}
		</script>
	</body>

</html>